<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<title>统计页面停留时间</title> 
</head> 
<body> 
<form name="form1" method="post" action=""> 
<center> 
<p>您已停留：</p> 
<p> 
<input name="input" type="text" value=""> 
</p> 
</center> 
<script language="javascript"> 
var second=0; 
var minute=0; 
var hour=0; 
window.setTimeout("interval();",1000); 
//统计网页停留时间
function interval() 
{ 
second++; 
if(second==60) 
{ 
second=0;minute+=1; 
} 
if(minute==60) 
{ 
minute=0;hour+=1; 
} 
document.form1.input.value = hour+"时"+minute+"分"+second+"秒"; 
window.setTimeout("interval();",1000); 
} 
</script> 
</form> 
</body> 
</html>